<template>
  <div class="app-bg span flex">
   <!-- <p class="h4" align="center"><b>分公司人员通讯录</b></p> -->
   <tools-page :need-back='false' title="通讯录"></tools-page>
   <!-- <tools-page title='通讯录'  :need-back="false"></tools-pager> -->

   <!-- <div class="form-group auto" style="position: relative;margin-right: 0;">
     <input type="text" class="form-control" id="contacts-name" aria-describedby="contacts-name"
     style="padding-left: 40px;" placeholder="输入联系人姓名搜索" v-model="name">
     <span class="glyphicon glyphicon-search form-control-feedback" aria-hidden="true" style="left: 0;"></span>
     <span id="inputSuccess2Status" class="sr-only">(success)</span>
   </div> -->
   <div class="span">
     <div class="app-input flex-between auto" v-for="row in model.data | filterBy name in 'username'" style="padding: 0px 10px;">
       <label class="control-label text-left flex-full" style="flex: 1;">{{row.name}}</label>
       <span class="glyphicon glyphicon-earphone" @click='makeAPhoneCall(row.tel)'>{{row.tel}}</span>
     </div>
   </div>

 </div>
  <!-- <div style="text-align:center,background-color:#6699cc;height:75px;">
    <div style="width=!00%;height:20px"></div>
    <p class="h4" align="center" style="vertical-align:middle;"><b>公司人员通讯录</b></p>
  </div>
<div>
    <table class="table table-hover">
        <tbody v-for="row in model.data | filterBy name in 'username'">
            <tr>
                <td>{{row.username}}
                    <br> {{row.name}}
                    <br>
                    <button class="btn btn-info btn-sm ">
                      {{row.tel}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-earphone" @click='makeAPhoneCall(row.tel)'></span>
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
    <div style="height:50px;"></div>
  </div> -->
</template>

<script>

import co from 'co'
import {
    PagedList
}
from 'vue-client'
import Vue from 'vue'

let info = function*(self, org) {
    let back = yield self.$post(Vue.url + 'rcq/communiCation', {data: {organizname: org}},
    // let back = yield self.$post('rs/rcq/communiCation', {data: {organizname: org}},
    { resolveMsg: null, rejectMsg: null })
    let hotline = {name: '西安奥枫软件有限公司', tel: '15339035958'}
    back.data.push(hotline)
    self.model = back
}

export default {
    title: '通讯录',
    data() {
        return {
            model: {}
        }
    },
    ready() {
        let infomathis = info(this, 'hah')
        co(infomathis)
    },
    methods: {
      makeAPhoneCall(phoneNo) {
        HostApp.makeAPhoneCall(phoneNo)
      }
    }
}

</script>
<style>
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-control-feedback{
  left:0;
  padding-left:8px;
}
.form-control{
  padding-left:55px;
}
</style>
